﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using umbraco.presentation.nodeFactory;
using System.Web;
using System.Xml;
using umbraco.presentation;

namespace Umb.SimpleWebsite.Shared.Content.Frontend
{
    public class FrontendContext
    {
        public FrontendContext()
        {

        }

        public static Node CurNode
        {
            get
            {
                int? curid = UmbracoContext.Current.PageId;
                return curid == null ? null : Node.GetCurrent();
            }
        }
        public static Site Site
        {
            get
            {
                Node node = CurNode;
                while (node != null && node.Parent != null) node = node.Parent;
                return new Site(node);
            }
        }

        
 


    }
}
